// Compoundset.cpp : implementation file
//

#include "stdafx.h"
#include "selectlesson.h"
#include "Compoundset.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// CCompoundset

IMPLEMENT_DYNAMIC(CCompoundset, CRecordset)

CCompoundset::CCompoundset(CDatabase* pdb)
	: CRecordset(pdb)
{
	//{{AFX_FIELD_INIT(CCompoundset)
	m_LessonNumber = 0;
	m_LessonName = _T("");
	m_TeacherNumber = 0;
	m_MaxNumber = 0;
	m_LessonNumber2 = 0;
	m_StudentNumber = 0;
	m_StudentNumber2 = 0;
	m_StudentName = _T("");
	m_Sex_male_ = FALSE;
	m_TeacherNumber2 = 0;
	m_TeacherName = _T("");
	m_Sex_male_2 = FALSE;
	m_nFields = 15;
	//}}AFX_FIELD_INIT
	m_nDefaultType = dynaset;
}


CString CCompoundset::GetDefaultConnect()
{
	return _T("ODBC;DSN=");
}

CString CCompoundset::GetDefaultSQL()
{
	return _T("[LessonInformation],[SelectInformation],[StudentInformation],[TeacherInformation]");
}

void CCompoundset::DoFieldExchange(CFieldExchange* pFX)
{
	//{{AFX_FIELD_MAP(CCompoundset)
	pFX->SetFieldType(CFieldExchange::outputColumn);
	RFX_Int(pFX, _T("[LessonInformation].[LessonNumber]"), m_LessonNumber);
	RFX_Text(pFX, _T("[LessonName]"), m_LessonName);
	RFX_Int(pFX, _T("[LessonInformation].[TeacherNumber]"), m_TeacherNumber);
	RFX_Date(pFX, _T("[BeginDate]"), m_BeginDate);
	RFX_Int(pFX, _T("[MaxNumber]"), m_MaxNumber);
	RFX_Int(pFX, _T("[SelectInformation].[LessonNumber]"), m_LessonNumber2);
	RFX_Int(pFX, _T("[SelectInformation].[StudentNumber]"), m_StudentNumber);
	RFX_Int(pFX, _T("[StudentInformation].[StudentNumber]"), m_StudentNumber2);
	RFX_Text(pFX, _T("[StudentName]"), m_StudentName);
	RFX_Bool(pFX, _T("[StudentInformation].[Sex(male)]"), m_Sex_male_);
	RFX_Date(pFX, _T("[StudentInformation].[Birthday]"), m_Birthday);
	RFX_Int(pFX, _T("[TeacherInformation].[TeacherNumber]"), m_TeacherNumber2);
	RFX_Text(pFX, _T("[TeacherName]"), m_TeacherName);
	RFX_Bool(pFX, _T("[TeacherInformation].[Sex(male)]"), m_Sex_male_2);
	RFX_Date(pFX, _T("[TeacherInformation].[Birthday]"), m_Birthday2);
	//}}AFX_FIELD_MAP
}

/////////////////////////////////////////////////////////////////////////////
// CCompoundset diagnostics

#ifdef _DEBUG
void CCompoundset::AssertValid() const
{
	CRecordset::AssertValid();
}

void CCompoundset::Dump(CDumpContext& dc) const
{
	CRecordset::Dump(dc);
}
#endif //_DEBUG
